home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 16
/
Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso
/
Aminet
/
util
/
batch
/
random.lha
/
Game.bat
next >
Wrap
DOS Batch File
|
1996-09-17
|
1KB
|
61 lines
;This is a simple AmigaDOS script file that combines the RequestChoice
;command found with WB2.1+ and the Random command that I wrote to create a
;stunningly interesting & enjoyable game!
Lab Start
; Set number of guesses to 0
Echo "0" >ENV:Guesses
; Pick a number between 1 and 10
Random 10 >ENV:RanNum
Lab Get_Guess
; Ask user what they think it is
RequestChoice >ENV:Choice "$Guesses guess(es) so far" "Pick a number, any number" "1|2|3|4|5|6|7|8|9|10"
Eval >ENV:G2 $Guesses + 1
Echo >ENV:Guesses $G2
If $Choice EQ "0"
Echo "10" >ENV:Choice
EndIf
If VAL $Choice EQ $RanNum
; They got it right!
RequestChoice >ENV:Again "Well done!" "You got it in $Guesses!*nDo you want another go?" "Go on then|Get lost!"
If $Again EQ "1"
Skip Start BACK
Else
Delete >NIL: ENV:Guesses QUIET FORCE
Delete >NIL: ENV:RanNum QUIET FORCE
Delete >NIL: ENV:Choice QUIET FORCE
Delete >NIL: ENV:G2 QUIET FORCE
Delete >NIL: ENV:Again QUIET FORCE
EndIf
Else
If VAL $Choice GT $RanNum
RequestChoice >NIL: "Ooooh, nearly ..." "That's too high!" "Doh!"
Else
RequestChoice >NIL: "Ooooh, nearly ..." "That's too low!" "Doh!"
EndIf
Skip Get_Guess BACK
EndIf